Optimal. Leaf size=69 \[ -\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}+\frac {2 a^2 \csc (c+d x)}{d}+a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3886, 3473, 8, 2606, 2607, 30} \[ -\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}+\frac {2 a^2 \csc (c+d x)}{d}+a^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2606
Rule 2607
Rule 3473
Rule 3886
Rubi steps
\begin {align*} \int \cot ^4(c+d x) (a+a \sec (c+d x))^2 \, dx &=\int \left (a^2 \cot ^4(c+d x)+2 a^2 \cot ^3(c+d x) \csc (c+d x)+a^2 \cot ^2(c+d x) \csc ^2(c+d x)\right ) \, dx\\ &=a^2 \int \cot ^4(c+d x) \, dx+a^2 \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx+\left (2 a^2\right ) \int \cot ^3(c+d x) \csc (c+d x) \, dx\\ &=-\frac {a^2 \cot ^3(c+d x)}{3 d}-a^2 \int \cot ^2(c+d x) \, dx+\frac {a^2 \operatorname {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}-\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\csc (c+d x)\right )}{d}\\ &=\frac {a^2 \cot (c+d x)}{d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {2 a^2 \csc (c+d x)}{d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}+a^2 \int 1 \, dx\\ &=a^2 x+\frac {a^2 \cot (c+d x)}{d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {2 a^2 \csc (c+d x)}{d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.27, size = 112, normalized size = 1.62 \[ \frac {a^2 \csc \left (\frac {c}{2}\right ) \csc ^3\left (\frac {1}{2} (c+d x)\right ) \left (-12 \sin \left (c+\frac {d x}{2}\right )+10 \sin \left (c+\frac {3 d x}{2}\right )-9 d x \cos \left (c+\frac {d x}{2}\right )-3 d x \cos \left (c+\frac {3 d x}{2}\right )+3 d x \cos \left (2 c+\frac {3 d x}{2}\right )-18 \sin \left (\frac {d x}{2}\right )+9 d x \cos \left (\frac {d x}{2}\right )\right )}{24 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 81, normalized size = 1.17 \[ \frac {5 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2} \cos \left (d x + c\right ) - 4 \, a^{2} + 3 \, {\left (a^{2} d x \cos \left (d x + c\right ) - a^{2} d x\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right ) - d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.43, size = 50, normalized size = 0.72 \[ \frac {6 \, {\left (d x + c\right )} a^{2} + \frac {9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.89, size = 112, normalized size = 1.62 \[ \frac {a^{2} \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+2 a^{2} \left (-\frac {\cos ^{4}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{4}\left (d x +c \right )}{3 \sin \left (d x +c \right )}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}\right )-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3 \sin \left (d x +c \right )^{3}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.72, size = 77, normalized size = 1.12 \[ \frac {{\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{2} + \frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 1\right )} a^{2}}{\sin \left (d x + c\right )^{3}} - \frac {a^{2}}{\tan \left (d x + c\right )^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.10, size = 39, normalized size = 0.57 \[ a^2\,x+\frac {a^2\,\left (9\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}{6\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int 2 \cot ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \cot ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \cot ^{4}{\left (c + d x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________